# Maintainer: David Runge <dvzrv@archlinux.org>

_name=pyphen
pkgname=python-pyphen
pkgver=0.14.0
pkgrel=2
pkgdesc="Pure Python module to hyphenate text"
arch=(any)
url="https://pyphen.org/"
license=(GPL2 LGPL2.1 MPL)
depends=(python)
makedepends=(python-build python-flit-core python-installer python-wheel)
checkdepends=(python-pytest)
source=(https://files.pythonhosted.org/packages/source/${_name::1}/$_name/$_name-$pkgver.tar.gz)
sha512sums=('5e242de2ecd5e951b2e1925df724013c14cea14729e8e0c132ab233c82406b37cc8d1d21cbd1edd748811fa6826a79da7a5ff9dfa859315840560cacae523e13')
b2sums=('3513ad1c9fbcc05318764f862a01bc4bbd6ad6a86f120ad93f8ff1d2a979984c35554db85943b5b7423f97e44ea933c64a3bf9c90aeb18629d215292466581b6')

build() {
  cd $_name-$pkgver
  python -m build --wheel --skip-dependency-check --no-isolation
}

check() {
  cd $_name-$pkgver
  pytest -v -c /dev/null tests/
}

package() {
  cd $_name-$pkgver
  python -m installer --destdir="$pkgdir" dist/*.whl
  install -vDm 644 README.rst -t "$pkgdir/usr/share/doc/$pkgname/"
}
